package com.onlyforfun.exchange.util;

import java.util.ArrayList;
import java.util.List;

import com.onlyforfun.exchange.domain.TimePrice;

public class Utils {
	public static List<TimePrice> resort(List<TimePrice> data, List<String> sortkeys) {

		List<TimePrice> sortedData = new ArrayList<TimePrice>();
		
		for (String sortName : sortkeys) {
			for (TimePrice timePrice : data) {
				if (sortName.equals(timePrice.getName())) {
					sortedData.add(timePrice);
					break;
				}
			}
		}
		return sortedData;
	}
}
